//
// Created by 刘昱杉2020 on 2023/4/14.
//

#ifndef CAR_DETECT_H
#define CAR_DETECT_H
#include "main.h"
#include "gpio.h"

#define SENSOR_NUM 5
#define STATE_STRAIGHT 0b00100
#define STATE_RIGHT 0b00010 || 0b00110
#define STATE_LEFT 0b01000 || 0b01100

//巡线状态
typedef enum {
    straight = 1,
    left,
    right,
    big_left,
    big_right,
    cross,
    no_line,
    error
}LineStatus;
extern const char *lineStatusStr[];
const char *getLineStatusString(LineStatus status);

typedef struct {
    uint16_t detect_sensor[SENSOR_NUM];
    uint8_t state;

}Detect;
//Function declaration
const char *Detect_GetState();


#endif //CAR_DETECT_H
